package com.hqyj.base.service.impl;

import com.hqyj.base.mapper.InfoProductsMapper;
import com.hqyj.base.model.InfoProducts;
import com.hqyj.base.model.InfoSupplier;
import com.hqyj.base.service.InfoProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: ERP-System
 * @Package: com.hqyj.base.service.impl
 * @ClassName: InfoProductsServiceImpl
 * @Author: LiYi
 * @Date: 2021-09-07 15:33
 */

@Service
public class InfoProductsServiceImpl implements InfoProductsService {
    @Autowired
    private InfoProductsMapper infoproductsMapper;

    @Override
    public List<InfoProducts> queryAllByInfoProducts() {
        return infoproductsMapper.queryAllByInfoProducts();
    }

    @Override
    public int addInfoProducts(InfoProducts infoProducts) {
        return infoproductsMapper.insertSelective(infoProducts);
    }

    @Override
    public int deleteInfoProductsById(int urlId) {
        return infoproductsMapper.deleteByPrimaryKey(urlId);
    }

    @Override
    public InfoProducts queryInfoProductsById(int urlId) {
        return infoproductsMapper.queryInfoProductsById(urlId);
    }

    @Override
    public int updateInfoProductById(InfoProducts infoProducts) {
        return infoproductsMapper.updateByPrimaryKeySelective(infoProducts);
    }

    @Override
    public List<InfoProducts> queryFuzzyInfoSupplier(String keyword) {
        return infoproductsMapper.queryFuzzyInfoSupplier(keyword);
    }
}
